import Vue from 'vue'
import Vuex from 'vuex'
import { IAppState } from './modules/app'
import { IUserState } from './modules/user'
import { ITagsViewState } from './modules/tags-view'
import { IErrorLogState } from './modules/error-log'
import { IPermissionState } from './modules/permission'
import { ISettingsState } from './modules/settings'
import { IRolesState } from './modules/roles'
import { IDeviceState } from './modules/device'
import { ILoginState } from './modules/login'
import { ISysUserState } from './modules/sys_user'
import { ISysMenuState } from './modules/menus'

Vue.use(Vuex)

export interface IRootState {
  app: IAppState
  user: IUserState
  login: ILoginState,
  tagsView: ITagsViewState
  errorLog: IErrorLogState
  permission: IPermissionState
  settings: ISettingsState
  roles: IRolesState
  devices: IDeviceState
  sysUser: ISysUserState
  menu: ISysMenuState
}

// Declare empty store first, dynamically register all modules later.
export default new Vuex.Store<IRootState>({})
